import { Controller } from 'egg';

export default class BaseController extends Controller {

  fomat(data:any, code:number) {
    const { ctx } = this;
    if (typeof data === 'string') {
      ctx.body = { msg: data, code };
    } else {
      ctx.body = { data, code };
    }
  }
}
